﻿using MediatR;
using System.ComponentModel.DataAnnotations;

namespace WebAPI中介者模式示例MediatR_EFCroe_Thransaction.Command
{
    // 创建订单命令
    public class CreateOrderCommand : IRequest<OrderResult>
    {
        [Required]
        public int ProductId { get; set; }

        [Required]
        [Range(1, 100, ErrorMessage = "数量必须在1-100之间")]
        public int Quantity { get; set; }
    }

    // 订单操作结果
    public class OrderResult
    {
        public bool Success { get; set; }
        public string Message { get; set; } = string.Empty;
        public int? OrderId { get; set; }
    }
}
